import com.test.kotlin.Motorbike
import com.test.kotlin.what

/**
 * Created by bmnp on 2017/12/27.
 */
fun main(args: Array<String>) {
    println("1 + 2 = " + sum(1, 2))
}

fun sum(param1: Int, param2: Int): Int {
    println("2 + 3 = " + sum("2", "3"))
    return param1 + param2
}

fun sum(param1: String, param2: String): Int {
    println("$param1 + $param2 = ${sum("5", 6)}")
    return Integer.parseInt(param1) + Integer.parseInt(param2)
}

fun sum(param1: String, param2: Int): Int {
    println(String())
    return Integer.parseInt(param1) + param2
}

fun private(param1: Int): Int {//方法名可以为关键字
    return param1
}

fun String(str: String = "默认值") {
    println(str)
    println(loop(7, 7))
}

fun loop(param1: Int, param2: Int): Int? {
    println(max(6, 18))
    var m  = Motorbike()
    m.drive();
    what()
    what()
    DefaultPackageBean().drive()
    if (param1 < param2) {
        return param2
    } else if (param1 > param2) {
        return param1
    } else {
        return null
    }
}

fun max(param1: Int, param2: Int) = if (param1 > param2) param1 else param2

fun test(): Unit {
    println("输出正确");
}
